﻿using FluentNHibernate.Mapping;
using Utility.Persistence_Service_Test.Entities;

namespace Utility.Persistence_Service_Test.Mappings
{
    public class KinokarteMap : ClassMap<Kinokarte>
    {
        public KinokarteMap()
        {
            Id(x => x.Id)
                .GeneratedBy.Identity()
                .Length(11);
            Map(x => x.Barcode)
                .Not.Nullable();
            References(x => x.Besucher)
                .Not.Nullable()
                .Not.LazyLoad();
            References(x => x.Kinosaal)
                .Not.Nullable()
                .Not.LazyLoad();
        }
    }
}
